package lt.marsrutai.mobile.android.util;

import android.app.Activity;
import android.content.Intent;

/**
 * Snippets for handling common activity actions.
 * 
 * @author Martynas
 *
 */
public class ActivityUtils {
    public static void restartFirstActivity(Activity activity) {
        Intent i = activity.getApplicationContext().getPackageManager().getLaunchIntentForPackage(
                activity.getApplicationContext().getPackageName());
        i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        activity.startActivity(i);
    }
}
